﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using util;
using System.Data;

namespace WebApplication1.studentUnion
{
    public partial class yijianshouji : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string stitle = title.Text;
            string scontent = content.Text;
            string sauthor = author.Text;
            string fileName = FileUpload1.PostedFile.FileName;
            string filePath = Server.MapPath("~/UploadFiles/");
            FileUpload1.SaveAs(filePath + fileName);
            string sql = "insert into notice(content,publisher,title,filename) values ('" +
                stitle + "','" + scontent + "','" + sauthor + "','" + fileName + "');";
            //获得MySsqlCommand
            DataTable Adt = MySqlHelper.GetDataTable(sql);
            Response.Write("<script>alert('发布成功！')</script>");
        }
    }
}